﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace MvvmEx.Converter
{
    /// <summary>
    /// BoolToVisibility的反向
    /// </summary>
    public class BoolToReverseVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var b = (bool)value;

            return b ? Visibility.Collapsed : Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return Binding.DoNothing;
        }
    }
}